﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LogicExpressionCalculator
{
    public class LogicOperator : AbstractExpressionObject
    {
        #region Properties
        /// <summary>
        /// Conjunction ^:
        /// p   q   p^q
        /// T   T   T
        /// T   F   F
        /// F   T   F
        /// F   F   F
        /// </summary>
        public static LogicOperator Conjunction = new LogicOperator(LogicOperatorType.Conjunction);
        /// <summary>
        /// Disjunction V
        /// p   q   pVq
        /// T   T   T
        /// T   F   T
        /// F   T   T
        /// F   F   F
        /// </summary>
        public static LogicOperator Disjunction = new LogicOperator(LogicOperatorType.Disjunction);
        /// <summary>
        /// Negation !
        /// p   !p
        /// T   F
        /// F   T
        /// </summary>
        public static LogicOperator Negation = new LogicOperator(LogicOperatorType.Negation); 
        /// <summary>
        /// Implication p->q
        /// p   q   p->q
        /// T   T   T
        /// T   F   F
        /// F   T   T
        /// F   F   T
        /// </summary>
        public static LogicOperator Implication = new LogicOperator(LogicOperatorType.Implication);
        /// <summary>
        /// Biconditional p=>q
        /// p   q   p=>q
        /// T   T   T
        /// T   F   F
        /// F   T   F
        /// F   F   T
        /// </summary>
        public static LogicOperator Biconditional = new LogicOperator(LogicOperatorType.Biconditional);

        /// <summary>
        /// Type
        /// </summary>
        public LogicOperatorType Type { get; protected set; }
        #endregion

        internal LogicOperator(LogicOperatorType type)
        {
            Type = type;
        }

        public override string ToString()
        {
            return Type.ToString();
        }
    }
}
